/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import { request } from '@umijs/max';
import {apiPrefixDispose} from "@/utils/format";

/** 获取Docker镜像列表 */
export async function listImages(
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<API.DockerImageVO[]>>(apiPrefixDispose('/docker/images'), {
    method: 'GET',
    ...(options || {}),
  });
}

/** 拉取Docker镜像 */
export async function pullImage(
  body: { imageName: string },
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<boolean>>(apiPrefixDispose('/docker/images/pull'), {
    method: 'POST',
    data: body,
    ...(options || {}),
  });
}

/** 上传Docker镜像 */
export async function uploadImage(
  body: FormData,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<boolean>>(apiPrefixDispose('/docker/images/upload'), {
    method: 'POST',
    data: body,
    ...(options || {}),
  });
}

/** 删除Docker镜像 */
export async function deleteImage(
  body: { imageId: string },
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<boolean>>(apiPrefixDispose('/docker/images/delete'), {
    method: 'POST',
    data: body,
    ...(options || {}),
  });
}

/** 获取Docker版本信息 */
export async function getDockerVersion(
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<API.DockerVersionVO>>(apiPrefixDispose('/docker/version'), {
    method: 'GET',
    ...(options || {}),
  });
}


/** 获取Docker相关文档 */
export async function getDockerDocs(
    options?: { [key: string]: any },
) {
  return request<API.ResultVO<API.DockerDocVO[]>>(apiPrefixDispose('/docker/docs'), {
    method: 'GET',
    ...(options || {}),
  });
}



/** 从路径导入Docker镜像 */
export async function importImage(
    body: API.ImportImageDTO,
    options?: { [key: string]: any },
) {
  return request<API.ResultVO<boolean>>(apiPrefixDispose('/docker/images/import'), {
    method: 'POST',
    data: body,
    ...(options || {}),
  });
}

/** 为Docker镜像添加标签 */
export async function tagImage(
    body: API.TagImageDTO,
    options?: { [key: string]: any },
) {
  return request<API.ResultVO<boolean>>(apiPrefixDispose('/docker/images/tag'), {
    method: 'POST',
    data: body,
    ...(options || {}),
  });
}


/** 启动Docker服务 */
export async function startDocker(options?: { [key: string]: any }) {
  return request<API.ResultVO<boolean>>(apiPrefixDispose('/docker/service/start'), {
    method: 'POST',
    ...(options || {}),
  });
}

/** 停止Docker服务 */
export async function stopDocker(options?: { [key: string]: any }) {
  return request<API.ResultVO<boolean>>(apiPrefixDispose('/docker/service/stop'), {
    method: 'POST',
    ...(options || {}),
  });
}

/** 重启Docker服务 */
export async function restartDocker(options?: { [key: string]: any }) {
  return request<API.ResultVO<boolean>>(apiPrefixDispose('/docker/service/restart'), {
    method: 'POST',
    ...(options || {}),
  });
}

/** 获取Docker服务状态 */
export async function getDockerStatus(options?: { [key: string]: any }) {
  return request<API.ResultVO<API.DockerServiceStatusVO>>(apiPrefixDispose('/docker/service/status'), {
    method: 'GET',
    ...(options || {}),
  });
}
